- 
                Notifications
    
You must be signed in to change notification settings  - Fork 421
 
          Decouple MessageRouter from Router
          #3326
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
          Codecov ReportAttention: Patch coverage is  
 
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #3326      +/-   ##
==========================================
- Coverage   89.64%   89.63%   -0.01%     
==========================================
  Files         126      126              
  Lines      102676   102657      -19     
  Branches   102676   102657      -19     
==========================================
- Hits        92043    92020      -23     
+ Misses       7909     7907       -2     
- Partials     2724     2730       +6     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry.  | 
    
ChannelManager is parameterized by a Router, which must also implement MessageRouter. Instead, add a MessageRouter parameter such that the Router and MessageRouter traits can be de-coupled. This simplifies using something other than DefaultMessageRouter, which DefaultRouter currently delegates to.
DefaultRouter::create_blinded_payment_paths may creat a one-hop blinded path with the recipient as the introduction node. Update the privacy section of DefaultRouter's docs to indicate this as is done in the docs for DefaultMessageRouter.
Now that ChannelManager is parameterized by both a MessageRouter and a Router, Router implementations no longer need to implement MessageRouter, too.
a8e08d2    to
    cad0985      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
| /// - [`Router`] for finding payment paths when initiating and retrying payments | ||
| /// - [`MessageRouter`] for finding message paths when initiating and retrying onion messages | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that Router, and MessageRouter are decoupled, should we consider renaming Router to PaymentRouter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this should be considered in a follow-up PR at least. Makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| /// - [`Router`] for finding payment paths when initiating and retrying payments | ||
| /// - [`MessageRouter`] for finding message paths when initiating and retrying onion messages | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this should be considered in a follow-up PR at least. Makes sense.
ChannelManageris parameterized by aRouter, which must also implementMessageRouter. Instead, add aMessageRouterparameter such that theRouterandMessageRoutertraits can be de-coupled. This simplifies using something other thanDefaultMessageRouter, whichDefaultRoutercurrently delegates to.